# Build stage
FROM maven:3.8.4-openjdk-8 AS builder
COPY src /home/app/src
COPY pom.xml /home/app
RUN mvn -f /home/app/pom.xml clean package -Dmaven.test.skip=true

# Package stage
FROM openjdk:8-jdk-alpine
COPY --from=builder /home/app/target/product-center-oms-0.0.1-SNAPSHOT.jar ./
EXPOSE 10011
ENTRYPOINT ["java","-jar","product-center-oms-0.0.1-SNAPSHOT.jar"]